package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.system.response.WarehousingEntryInfoDetailList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WarehousingEntryInfoMapper;
import com.ruoyi.system.domain.WarehousingEntryInfo;
import com.ruoyi.system.service.IWarehousingEntryInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 入库单物料详情Service业务层处理
 *
 * @author tanshen
 * @date 2023-08-23
 */
@Service
public class WarehousingEntryInfoServiceImpl extends ServiceImpl<WarehousingEntryInfoMapper, WarehousingEntryInfo> implements IWarehousingEntryInfoService {
    @Autowired
    private WarehousingEntryInfoMapper warehousingEntryInfoMapper;

    /**
     * 查询入库单物料详情
     *
     * @param id 入库单物料详情主键
     * @return 入库单物料详情
     */
    @Override
    public WarehousingEntryInfo selectWarehousingEntryInfoById(Long id) {
        return warehousingEntryInfoMapper.selectWarehousingEntryInfoById(id);
    }

    /**
     * 查询入库单物料详情列表
     *
     * @param warehousingEntryInfo 入库单物料详情
     * @return 入库单物料详情
     */
    @Override
    public List<WarehousingEntryInfo> selectWarehousingEntryInfoList(WarehousingEntryInfo warehousingEntryInfo) {
        return warehousingEntryInfoMapper.selectWarehousingEntryInfoList(warehousingEntryInfo);
    }

    /**
     * 新增入库单物料详情
     *
     * @param warehousingEntryInfo 入库单物料详情
     * @return 结果
     */
    @Override
    public int insertWarehousingEntryInfo(WarehousingEntryInfo warehousingEntryInfo) {
        return warehousingEntryInfoMapper.insertWarehousingEntryInfo(warehousingEntryInfo);
    }

    /**
     * 修改入库单物料详情
     *
     * @param warehousingEntryInfo 入库单物料详情
     * @return 结果
     */
    @Override
    public int updateWarehousingEntryInfo(WarehousingEntryInfo warehousingEntryInfo) {
        return warehousingEntryInfoMapper.updateWarehousingEntryInfo(warehousingEntryInfo);
    }

    /**
     * 批量删除入库单物料详情
     *
     * @param ids 需要删除的入库单物料详情主键
     * @return 结果
     */
    @Override
    public int deleteWarehousingEntryInfoByIds(String ids) {
        return warehousingEntryInfoMapper.deleteWarehousingEntryInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除入库单物料详情信息
     *
     * @param id 入库单物料详情主键
     * @return 结果
     */
    @Override
    public int deleteWarehousingEntryInfoById(Long id) {
        return warehousingEntryInfoMapper.deleteWarehousingEntryInfoById(id);
    }

    @Override
    public List<WarehousingEntryInfoDetailList> detailList(String entryOrderId) {
        return warehousingEntryInfoMapper.detailList(entryOrderId);
    }
}
